package com.back.network.web.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.back.network.web.entity.EmailInfo;

public interface EmailInfoDao {

	@Insert("INSERT INTO email_info (email,code) VALUE(#{email},#{code})")
	int save(EmailInfo emailInfo);

	@Select("SELECT COUNT(1) FROM email_info WHERE email=#{email} AND  CODE = #{code} AND DATE_ADD(creat_time, INTERVAL 10 MINUTE)>NOW()")
	int checkCode(EmailInfo emailInfo);

}
